<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"halma.gitee.io","root":"/","scheme":"Pisces","version":"7.7.2","exturl":false,"sidebar":{"position":"right","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":true,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="本重点讲述在Asus z370-p-8700k-Vega56上黑苹果时，需要关注的重点问题，也是黑果们必须经历的。涉及到Bios设置、ACPI调教、AMD显卡属性注入等等内容。">
<meta property="og:type" content="article">
<meta property="og:title" content="Asus z370-p_8700k_Vega56 安装苹果系统攻略">
<meta property="og:url" content="https://halma.gitee.io/2020/2020-4-2/index.html">
<meta property="og:site_name" content="左右流之的放逐岛">
<meta property="og:description" content="本重点讲述在Asus z370-p-8700k-Vega56上黑苹果时，需要关注的重点问题，也是黑果们必须经历的。涉及到Bios设置、ACPI调教、AMD显卡属性注入等等内容。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://halma.gitee.io/2020/2020-4-2/laytou.png">
<meta property="og:image" content="https://halma.gitee.io/2020/2020-4-2/z370usb1.jpg">
<meta property="og:image" content="https://halma.gitee.io/2020/2020-4-2/z370usb2.jpg">
<meta property="og:image" content="https://halma.gitee.io/2020/2020-4-2/z370usb3.jpg">
<meta property="og:image" content="https://halma.gitee.io/2020/2020-4-2/usbinfo.png">
<meta property="og:image" content="https://halma.gitee.io/2020/2020-4-2/DeviceProperties.png">
<meta property="og:image" content="https://halma.gitee.io/2020/2020-4-2/fbname1.png">
<meta property="og:image" content="https://halma.gitee.io/2020/2020-4-2/fbnamepatch.png">
<meta property="og:image" content="https://halma.gitee.io/2020/2020-4-2/blackscreen.png">
<meta property="article:published_time" content="2020-04-02T03:36:33.000Z">
<meta property="article:modified_time" content="2020-04-29T11:38:08.594Z">
<meta property="article:author" content="左右流之">
<meta property="article:tag" content="Asus">
<meta property="article:tag" content="z370-p">
<meta property="article:tag" content="8700k">
<meta property="article:tag" content="Vega56">
<meta property="article:tag" content="安装苹果系统攻略">
<meta property="article:tag" content="左右流之">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://halma.gitee.io/2020/2020-4-2/laytou.png">

<link rel="canonical" href="https://halma.gitee.io/2020/2020-4-2/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Asus z370-p_8700k_Vega56 安装苹果系统攻略 | 左右流之的放逐岛</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">左右流之的放逐岛</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">黑苹果技术分享</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://halma.gitee.io/2020/2020-4-2/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="左右流之">
      <meta itemprop="description" content="折腾不需要理由">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="左右流之的放逐岛">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Asus z370-p_8700k_Vega56 安装苹果系统攻略
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-04-02 11:36:33" itemprop="dateCreated datePublished" datetime="2020-04-02T11:36:33+08:00">2020-04-02</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-04-29 19:38:08" itemprop="dateModified" datetime="2020-04-29T19:38:08+08:00">2020-04-29</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Hackintosh/" itemprop="url" rel="index"><span itemprop="name">Hackintosh</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
  
  
            <div class="post-description">本重点讲述在Asus z370-p-8700k-Vega56上黑苹果时，需要关注的重点问题，也是黑果们必须经历的。涉及到Bios设置、ACPI调教、AMD显卡属性注入等等内容。</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>Asus z370-p_8700k _Vega56 ，在2017年算是很流行的黑苹果主机配置。Vega56显卡属于iMacpro1,1的选择，而8700k与Asus z370的搭配，又属于iMac机型的配置。所以这套主机配置经常纠结于iMacPro和iMac的选择中。<br>总体而言，这套配置比较适合iMacPro，这是经过对主板问题的研究以及核显驱动在z370主板上的缺陷得到的认知。</p>
<h2 id="一、基本功课"><a href="#一、基本功课" class="headerlink" title="一、基本功课"></a>一、基本功课</h2><ol>
<li><h3 id="主板Bios重点项目设置"><a href="#主板Bios重点项目设置" class="headerlink" title="主板Bios重点项目设置"></a>主板Bios重点项目设置</h3></li>
</ol>
<table>
<thead>
<tr>
<th>Bios项目</th>
<th>设置</th>
<th>备注</th>
</tr>
</thead>
<tbody><tr>
<td>VT-d</td>
<td>disabled</td>
<td>对FCPX有帮助</td>
</tr>
<tr>
<td>Secure boot state</td>
<td>disabled</td>
<td></td>
</tr>
<tr>
<td>Primary Display</td>
<td>Auto</td>
<td></td>
</tr>
<tr>
<td>iGPU Multi-Monitor</td>
<td>Disable</td>
<td>iMac机型设置成enable</td>
</tr>
<tr>
<td>CFG Lock</td>
<td>Disable</td>
<td>一个超级重要的设置</td>
</tr>
</tbody></table>
<ul>
<li><strong>关于Primary Display</strong> 此项为主显示器设置，比较普遍的设置是PCIE。但是在黑果的过程中，可能会出现意外情况会导致屏幕无法点亮，连Bios都看不见的情况。这时候你可能做的只有重置BIOS了，或者连重置都没机会，只能编程器刷BIOS了。所以为了保险还是设置成自动比较好。</li>
<li><strong>CFG Lock</strong> 就是<font color="#FF8800">CFG</font>锁，主板默认设置为<font color="#FF8800">Disable</font>，为<font color="#FF8800">CFG</font>开启状态，也就是系统可以些入<font color="#339933">NVRAM</font>信息。设置成<font color="#FF8800">enable</font>反而是上锁了。这个项目的设置对于黑苹果特别重要，比如你在引导里换了机型设置，如果<font color="#FF8800">CFG Lock</font>上锁了，结果就是死机，严重的就要刷BIOS。</li>
</ul>
<ol start="2">
<li><h3 id="核显与机型"><a href="#核显与机型" class="headerlink" title="核显与机型"></a>核显与机型</h3>使用iMac19,1/19,2机型，需要开启核显，但必须使用WhateverGreen.kext。使用iMacPro机型最好关闭核显，否则你还是需要WhateverGreen.kext驱动。<br>这是由于z370主板Bios的缺陷造成的。引起这个缺陷的是Bios里的IntelGuc(核显中负责媒体编解码的固件)。对于Asus Z370主板，最新的Bios停留在2019/07/18的2401版，虽然升级了ME(CPU微码)，但是guc的问题依然如故。WhateverGreen.kext驱动实际上等于禁用Guc。我在WhateverGreen-1.3.8.kext上强制开启guc功能，结果还是IGPU通不过。<br>从返回的错误报告看，主要是<font color="#339933">AppleIntelKBLGraphics.kext</font>驱动发生了错误。<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">Kernel Extensions in backtrace:</span><br><span class="line">com.apple.driver.AppleIntelKBLGraphics(14.0.4)[820679F0-1A2F-3F76-AEBD-24E3393CDFCD]@0xffffff7f96868000-&gt;0xffffff7f9695afff</span><br><span class="line">   dependency: com.apple.iokit.IOPCIFamily(2.9)[ADD485B5-3EF8-37C4-B3C5-F86326E497A4]@0xffffff7f91514000</span><br><span class="line">   ...</span><br></pre></td></tr></table></figure>
所以，如果用iMac机型，需要使用<font color="#339933">WhateverGreen.kext</font>驱动，结果就是核显大多数情况不会满载，GFX的频率会处于一个较低的水平，比如不超过0.35GHz。这样一来，开启核显形同鸡肋。<br>对于使用Vega这样可以双解的显卡，直接选择iMacPro机型，免得麻烦。</li>
<li><h3 id="补充"><a href="#补充" class="headerlink" title="补充"></a>补充</h3><font color="#C93">使用最新的WhateverGreen1.3.8版，情况得到改善，特别是FCPX上编码导出HEVC有绝对的用处。</font>参见：<a href="http://zuoyoulz.top/2020/4-9/" target="_blank" rel="noopener">http://zuoyoulz.top/2020/4-9/</a> 第四部分。</li>
</ol>
<hr>
<h2 id="二、调教ACPI"><a href="#二、调教ACPI" class="headerlink" title="二、调教ACPI"></a>二、调教ACPI</h2><p>完善黑苹果的主要部分应该是调教ACPI，涉及ACPI补丁，包括电源管理、RTC、显卡位置等一系列问题。</p>
<ol>
<li><h3 id="XCPM"><a href="#XCPM" class="headerlink" title="XCPM"></a>XCPM</h3><p>Asus z370主板需要对CPU部分的<font color="#FF8800">PR00</font>打SSDT补丁，以加载原生电源管理，以下为宪武制作的SSDT-XCPM补丁。</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br></pre></td><td class="code"><pre><span class="line">DefinitionBlock (<span class="string">""</span>, <span class="string">"SSDT"</span>, <span class="number">2</span>, <span class="string">"CpuRef"</span>, <span class="string">"CpuPlug"</span>, <span class="number">0x00003000</span>)</span><br><span class="line">&#123;</span><br><span class="line">    External (_PR_.PR00, ProcessorObj)</span><br><span class="line"></span><br><span class="line">    Scope (_PR.PR00)</span><br><span class="line">    &#123;</span><br><span class="line">        Method (DTGP, <span class="number">5</span>, NotSerialized)</span><br><span class="line">        &#123;</span><br><span class="line">            If ((Arg0 == ToUUID (<span class="string">"a0b5b7c6-1318-441c-b0c9-fe695eaf949b"</span>)))</span><br><span class="line">            &#123;</span><br><span class="line">                If ((Arg1 == One))</span><br><span class="line">                &#123;</span><br><span class="line">                    If ((Arg2 == Zero))</span><br><span class="line">                    &#123;</span><br><span class="line">                        Arg4 = Buffer (One)</span><br><span class="line">                            &#123;</span><br><span class="line">                                 <span class="number">0x03</span>        </span><br><span class="line">                            &#125;</span><br><span class="line">                        Return (One)</span><br><span class="line">                    &#125;</span><br><span class="line"></span><br><span class="line">                    If ((Arg2 == One))</span><br><span class="line">                    &#123;</span><br><span class="line">                        Return (One)</span><br><span class="line">                    &#125;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line"></span><br><span class="line">            Arg4 = Buffer (One)</span><br><span class="line">                &#123;</span><br><span class="line">                     <span class="number">0x00</span></span><br><span class="line">                &#125;</span><br><span class="line">            Return (Zero)</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        Method (_DSM, <span class="number">4</span>, NotSerialized)  <span class="comment">// _DSM: Device-Specific Method</span></span><br><span class="line">        &#123;</span><br><span class="line">            Local0 = Package (<span class="number">0x02</span>)</span><br><span class="line">                &#123;</span><br><span class="line">                    <span class="string">"plugin-type"</span>, </span><br><span class="line">                    One</span><br><span class="line">                &#125;</span><br><span class="line">            DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))</span><br><span class="line">            Return (Local0)</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>将此编译为asl文件后，放入OC引导的APCI中，并同时在oc的配置文件里写入此ssdt。</p>
</li>
<li><h3 id="EC控制器"><a href="#EC控制器" class="headerlink" title="EC控制器"></a>EC控制器</h3><p>ASUS z370-p  主板的EC控制器名为<font color="#FF8800">H_EC</font></p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">Device (H_EC)</span><br><span class="line">&#123;</span><br><span class="line">    Name (_HID, EisaId (<span class="string">"PNP0C09"</span>) <span class="comment">/* Embedded Controller Device */</span>)  <span class="comment">// _HID: Hardware ID</span></span><br><span class="line">    Name (_UID, One)  <span class="comment">// _UID: Unique ID</span></span><br><span class="line">    Method (_STA, <span class="number">0</span>, NotSerialized)  <span class="comment">// _STA: Status</span></span><br><span class="line">    &#123;</span><br><span class="line">        ^^^GFX0.CLID = <span class="number">0x03</span></span><br><span class="line">        Return (Zero)</span><br><span class="line">    &#125;</span><br><span class="line">    ...</span><br><span class="line">    Return (Zero)</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>由于直接返回的Zero，所以这个EC控制器是没有启用的，我们也就不必管它了。</p>
</li>
<li><h3 id="PMCR"><a href="#PMCR" class="headerlink" title="PMCR"></a>PMCR</h3><p><font color="#FF8800">PMCR</font>是苹果的部件，在300系主板中是不存在的。OpenCore引导中直接推荐使用SSDT-PMC补丁。</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br></pre></td><td class="code"><pre><span class="line">DefinitionBlock (<span class="string">""</span>, <span class="string">"SSDT"</span>, <span class="number">2</span>, <span class="string">"ACDT"</span>, <span class="string">"PMCR"</span>, <span class="number">0x00001000</span>)</span><br><span class="line">&#123;</span><br><span class="line">    External (_SB_.PCI0.LPCB, DeviceObj)</span><br><span class="line"></span><br><span class="line">    Scope (_SB.PCI0.LPCB)</span><br><span class="line">    &#123;</span><br><span class="line">        Device (PMCR)</span><br><span class="line">        &#123;</span><br><span class="line">            Name (_HID, EisaId (<span class="string">"APP9876"</span>))  <span class="comment">// _HID: Hardware ID</span></span><br><span class="line">            Method (_STA, <span class="number">0</span>, NotSerialized)  <span class="comment">// _STA: Status</span></span><br><span class="line">            &#123;</span><br><span class="line">                If (_OSI (<span class="string">"Darwin"</span>))</span><br><span class="line">                &#123;</span><br><span class="line">                    Return (<span class="number">0x0B</span>)</span><br><span class="line">                &#125;</span><br><span class="line">                Else</span><br><span class="line">                &#123;</span><br><span class="line">                    Return (Zero)</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line"></span><br><span class="line">            Name (_CRS, ResourceTemplate ()  <span class="comment">// _CRS: Current Resource Settings</span></span><br><span class="line">            &#123;</span><br><span class="line">                Memory32Fixed (ReadWrite,</span><br><span class="line">                    <span class="number">0xFE000000</span>,         <span class="comment">// Address Base</span></span><br><span class="line">                    <span class="number">0x00010000</span>,         <span class="comment">// Address Length</span></span><br><span class="line">                    )</span><br><span class="line">            &#125;)</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li>
<li><h3 id="RTC"><a href="#RTC" class="headerlink" title="RTC"></a>RTC</h3><p>Asus Z370的<font color="#FF8800">RTC</font>驱动中没有<font color="#FF8800">_STA</font>方法，所以我将其禁用，并仿冒了一个白苹果上的<font color="#FF8800">ARTC</font>。</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br></pre></td><td class="code"><pre><span class="line">DefinitionBlock (<span class="string">""</span>, <span class="string">"SSDT"</span>, <span class="number">2</span>, <span class="string">"ACDT"</span>, <span class="string">"RTC0"</span>, <span class="number">0x00000000</span>)</span><br><span class="line">&#123;</span><br><span class="line">    External (_SB_.PCI0.LPCB, DeviceObj)</span><br><span class="line">    External (_SB_.PCI0.LPCB.RTC_, DeviceObj)</span><br><span class="line">    External (RTC_, DeviceObj)</span><br><span class="line"></span><br><span class="line">    Scope (_SB.PCI0.LPCB)</span><br><span class="line">    &#123;</span><br><span class="line">        Scope (RTC)</span><br><span class="line">        &#123;</span><br><span class="line">            Method (_STA, <span class="number">0</span>, NotSerialized)  <span class="comment">// _STA: Status</span></span><br><span class="line">            &#123;</span><br><span class="line">                If (_OSI (<span class="string">"Darwin"</span>))</span><br><span class="line">                &#123;</span><br><span class="line">                    Return (Zero)            <span class="comment">//禁用RTC</span></span><br><span class="line">                &#125;</span><br><span class="line">                Else</span><br><span class="line">                &#123;</span><br><span class="line">                    Return (<span class="number">0x0F</span>)</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line"></span><br><span class="line">        Device (ARTC)                      <span class="comment">//仿冒ARTC</span></span><br><span class="line">        &#123;</span><br><span class="line">            Name (_HID, EisaId (<span class="string">"PNP0B00"</span>) <span class="comment">/* AT Real-Time Clock */</span>)  <span class="comment">// _HID: Hardware ID</span></span><br><span class="line">            Name (_CRS, ResourceTemplate ()  <span class="comment">// _CRS: Current Resource Settings</span></span><br><span class="line">            &#123;</span><br><span class="line">                IO (Decode16,</span><br><span class="line">                    <span class="number">0x0070</span>,             <span class="comment">// Range Minimum</span></span><br><span class="line">                    <span class="number">0x0070</span>,             <span class="comment">// Range Maximum</span></span><br><span class="line">                    <span class="number">0x01</span>,               <span class="comment">// Alignment</span></span><br><span class="line">                    <span class="number">0x08</span>,               <span class="comment">// Length</span></span><br><span class="line">                    )</span><br><span class="line">                IRQNoFlags ()</span><br><span class="line">                    &#123;<span class="number">8</span>&#125;</span><br><span class="line">            &#125;)</span><br><span class="line">            Method (_STA, <span class="number">0</span>, NotSerialized)  <span class="comment">// _STA: Status</span></span><br><span class="line">            &#123;</span><br><span class="line">                If (_OSI (<span class="string">"Darwin"</span>))</span><br><span class="line">                &#123;</span><br><span class="line">                    Return (<span class="number">0x0F</span>)</span><br><span class="line">                &#125;</span><br><span class="line">                Else</span><br><span class="line">                &#123;</span><br><span class="line">                    Return (Zero)</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li>
<li><h3 id="GRPW"><a href="#GRPW" class="headerlink" title="GRPW"></a>GRPW</h3><p>ASUS z370-p 在<font color="#FF8800">GLAN、XHC、XDCI、HDAS</font>设备上，电源唤醒存在问题：</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">Method (_PRW, <span class="number">0</span>, NotSerialized)  <span class="comment">// _PRW: Power Resources for Wake</span></span><br><span class="line">&#123;</span><br><span class="line">    Return (GPRW (<span class="number">0x6D</span>, <span class="number">0x04</span>))</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<p>这就需要使用<font color="#FF8800">0D/6D</font>补丁，我的做法是强制用二进制补丁改成</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Return (GPRW (<span class="number">0x6D</span>, <span class="number">0x00</span>))</span><br></pre></td></tr></table></figure>
<p>因为我没有Windows系统。如果和Windows共存，请使用宪武的 <a href="https://github.com/daliansky/OC-little/tree/master/12-060D补丁/12-1-普通的060D补丁" target="_blank" rel="noopener">https://github.com/daliansky/OC-little/tree/master/12-060D补丁/12-1-普通的060D补丁</a> 。</p>
</li>
<li><h3 id="BUS0"><a href="#BUS0" class="headerlink" title="BUS0"></a>BUS0</h3><p>Asus Z370-p系统管理总线名称为<font color="#FF8800">BUS0</font>，总线地址为<font color="#FF8800">“0x001F0004”</font>。</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">Device (SBUS)</span><br><span class="line">       &#123;</span><br><span class="line">           Name (_ADR, <span class="number">0x001F0004</span>)  <span class="comment">// _ADR: Address</span></span><br><span class="line">           Method (_DSM, <span class="number">4</span>, Serialized)  <span class="comment">// _DSM: Device-Specific Method</span></span><br><span class="line">           &#123;</span><br><span class="line">               If (PCIC (Arg0))</span><br><span class="line">               &#123;</span><br><span class="line">                   Return (PCID (Arg0, Arg1, Arg2, Arg3))</span><br><span class="line">               &#125;</span><br><span class="line"></span><br><span class="line">               Return (Buffer (One)</span><br><span class="line">               &#123;</span><br><span class="line">                    <span class="number">0x00</span>  </span><br><span class="line">               &#125;)</span><br><span class="line">           &#125;</span><br><span class="line">       &#125;</span><br></pre></td></tr></table></figure>
<p>我们通过SSDT-SBUS为其注入一些苹果系统需要的内容。</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br></pre></td><td class="code"><pre><span class="line">DefinitionBlock (<span class="string">""</span>, <span class="string">"SSDT"</span>, <span class="number">2</span>, <span class="string">"ACDT"</span>, <span class="string">"SBUS"</span>, <span class="number">0x00000000</span>)</span><br><span class="line">&#123;</span><br><span class="line">    External (_SB_.PCI0.SBUS, DeviceObj)</span><br><span class="line"></span><br><span class="line">    Scope (_SB.PCI0.SBUS)</span><br><span class="line">    &#123;</span><br><span class="line">        Device (BUS0)</span><br><span class="line">        &#123;</span><br><span class="line">            Name (_CID, <span class="string">"smbus"</span>)  <span class="comment">// _CID: Compatible ID</span></span><br><span class="line">            Name (_ADR, Zero)  <span class="comment">// _ADR: Address</span></span><br><span class="line">            Device (DVL0)</span><br><span class="line">            &#123;</span><br><span class="line">                Name (_ADR, <span class="number">0x57</span>)  <span class="comment">// _ADR: Address</span></span><br><span class="line">                Name (_CID, <span class="string">"diagsvault"</span>)  <span class="comment">// _CID: Compatible ID</span></span><br><span class="line">                Method (_DSM, <span class="number">4</span>, NotSerialized)  <span class="comment">// _DSM: Device-Specific Method</span></span><br><span class="line">                &#123;</span><br><span class="line">                    If (!Arg2)</span><br><span class="line">                    &#123;</span><br><span class="line">                        Return (Buffer (One)</span><br><span class="line">                        &#123;</span><br><span class="line">                             <span class="number">0x03</span>   </span><br><span class="line">                        &#125;)</span><br><span class="line">                    &#125;</span><br><span class="line"></span><br><span class="line">                    Return (Package (<span class="number">0x02</span>)</span><br><span class="line">                    &#123;</span><br><span class="line">                        <span class="string">"address"</span>, </span><br><span class="line">                        <span class="number">0x57</span></span><br><span class="line">                    &#125;)</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line"></span><br><span class="line">            Method (_STA, <span class="number">0</span>, NotSerialized)  <span class="comment">// _STA: Status</span></span><br><span class="line">            &#123;</span><br><span class="line">                If (_OSI (<span class="string">"Darwin"</span>))</span><br><span class="line">                &#123;</span><br><span class="line">                    Return (<span class="number">0x0F</span>)</span><br><span class="line">                &#125;</span><br><span class="line">                Else</span><br><span class="line">                &#123;</span><br><span class="line">                    Return (Zero)</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li>
<li><h3 id="PEG0"><a href="#PEG0" class="headerlink" title="PEG0"></a>PEG0</h3><p>主板ACPI中，第一个PCIE插槽没有太多驱动设置，只给出了<font color="#FF8800">PCI0-PEG0-PEGP</font>这样的一个路径。实际的显卡路径要多2层，所以显卡需要得到正确的硬件位置，才能正确驱动。方法有两种，一种是SSDT注入，一种是在OpenCore引导的设备属性项目中注入。后一种方法移到下一段中说明。还有一种是以上两种方法联合使用。正确驱动的路径是<font color="#FF8800"> _SB.PCI0.PEG0.PEGP. EGP1.GFX0</font>，重点是最后的位置名称为GFX0，在不对ACPI做重命名的情况下，需要再注入两层设备。<br>我们先看看原始ACPI中的PEGP部分：</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">Device (PEG0)</span><br><span class="line">           &#123;</span><br><span class="line">               Name (_ADR, <span class="number">0x00010000</span>)  <span class="comment">// _ADR: Address</span></span><br><span class="line">               Method (_PRT, <span class="number">0</span>, NotSerialized)  <span class="comment">// _PRT: PCI Routing Table</span></span><br><span class="line">               &#123;</span><br><span class="line">                   If (PICM)</span><br><span class="line">                   &#123;</span><br><span class="line">                       Return (AR01) <span class="comment">/* \_SB_.AR01 */</span></span><br><span class="line">                   &#125;</span><br><span class="line"></span><br><span class="line">                   Return (PR01) <span class="comment">/* \_SB_.PR01 */</span></span><br><span class="line">               &#125;</span><br><span class="line"></span><br><span class="line">               Device (PEGP)</span><br><span class="line">               &#123;</span><br><span class="line">                   Name (_ADR, Zero)  <span class="comment">// _ADR: Address</span></span><br><span class="line">               &#125;</span><br><span class="line">           &#125;</span><br></pre></td></tr></table></figure>
<p>由于PEGP驱动直接返回了<font color="#FF8800">Zero</font>，省去了屏蔽PEG0设备的麻烦，直接将<font color="#FF8800">_SB.PCI0.PEG0.PEGP</font> 在SSDT声明中包含进来。</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">Scope (_SB.PCI0.PEG0.PEGP)</span><br><span class="line">   &#123;</span><br><span class="line">       Device (EGP1)</span><br><span class="line">       &#123;</span><br><span class="line">           Device (GFX0)</span><br></pre></td></tr></table></figure>
<p>EGP1和GFX0是自定义的，EGP1的名字只要不冲突就可以了，GFX0则是苹果独显的规范，以便加载AGPM。另外，由于显卡初始化的问题，需要对在此SSDT中使用Mieze大神的方法做寄存器变换，解决BAR初始化错误。以下是不带设备属性的显卡SSDT。</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br></pre></td><td class="code"><pre><span class="line">DefinitionBlock (<span class="string">""</span>, <span class="string">"SSDT"</span>, <span class="number">2</span>, <span class="string">"ACDT"</span>, <span class="string">"GRAPHICS"</span>, <span class="number">0x00001000</span>)</span><br><span class="line">&#123;</span><br><span class="line">    External (_SB_.PCI0, DeviceObj)</span><br><span class="line">    External (_SB_.PCI0.GFX0, DeviceObj)</span><br><span class="line">    External (_SB_.PCI0.LPCB, DeviceObj)</span><br><span class="line">    External (_SB_.PCI0.PEG0, DeviceObj)</span><br><span class="line">    External (_SB_.PCI0.PEG0.PEGP, DeviceObj)</span><br><span class="line">    External (_SB_.PEPD, DeviceObj)</span><br><span class="line">    External (BLCP, FieldUnitObj)</span><br><span class="line">    External (BLCT, IntObj)</span><br><span class="line">    External (BRTL, FieldUnitObj)</span><br><span class="line">    External (CPSC, UnknownObj)</span><br><span class="line">    External (DLHR, FieldUnitObj)</span><br><span class="line">    External (DSEN, UnknownObj)</span><br><span class="line">    External (ECON, IntObj)</span><br><span class="line">    External (EGPS, FieldUnitObj)</span><br><span class="line">    External (MUTX, MutexObj)</span><br><span class="line">    External (OSYS, FieldUnitObj)</span><br><span class="line">    External (PEPD, UnknownObj)</span><br><span class="line">    External (RTC_, DeviceObj)</span><br><span class="line">    External (S0ID, FieldUnitObj)</span><br><span class="line">    External (SSMP, FieldUnitObj)</span><br><span class="line">    External (SSMY, FieldUnitObj)</span><br><span class="line">    External (STAS, IntObj)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    Scope (_SB.PCI0.PEG0.PEGP)</span><br><span class="line">    &#123;</span><br><span class="line">        Device (EGP1)</span><br><span class="line">        &#123;</span><br><span class="line">            Name (_ADR, Zero)</span><br><span class="line">            Method (_STA, <span class="number">0</span>, NotSerialized) </span><br><span class="line">            &#123;</span><br><span class="line">                If (_OSI (<span class="string">"Darwin"</span>))</span><br><span class="line">                &#123;</span><br><span class="line">                    Return (<span class="number">0x0F</span>)</span><br><span class="line">                &#125;</span><br><span class="line">                Else</span><br><span class="line">                &#123;</span><br><span class="line">                    Return (Zero)</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line"></span><br><span class="line">            Device (GFX0)</span><br><span class="line">            &#123;</span><br><span class="line">                Name (_ADR, Zero) </span><br><span class="line">                OperationRegion (PCIB, PCI_Config, Zero, <span class="number">0x0100</span>)</span><br><span class="line">                Field (PCIB, AnyAcc, NoLock, Preserve)     <span class="comment">//定义寄存器变量</span></span><br><span class="line">                &#123;                                   </span><br><span class="line">                    Offset (<span class="number">0x10</span>), </span><br><span class="line">                    BAR0,   <span class="number">32</span>, </span><br><span class="line">                    BAR1,   <span class="number">32</span>, </span><br><span class="line">                    BAR2,   <span class="number">64</span>, </span><br><span class="line">                    BAR4,   <span class="number">32</span>, </span><br><span class="line">                    BAR5,   <span class="number">32</span></span><br><span class="line">                &#125;</span><br><span class="line"></span><br><span class="line">                Method (_INI, <span class="number">0</span>, NotSerialized)           <span class="comment">//寄存器变换</span></span><br><span class="line">                &#123;</span><br><span class="line">                    If ((BAR5 == Zero))</span><br><span class="line">                    &#123;</span><br><span class="line">                        Local0 = BAR2 <span class="comment">/* \_SB_.PCI0.PEG0.PEGP.EGP1.GFX0.BAR2 */</span></span><br><span class="line">                    &#125;</span><br><span class="line">                    Else</span><br><span class="line">                    &#123;</span><br><span class="line">                        Local0 = BAR5 <span class="comment">/* \_SB_.PCI0.PEG0.PEGP.EGP1.GFX0.BAR5 */</span></span><br><span class="line">                    &#125;</span><br><span class="line"></span><br><span class="line">                    OperationRegion (GREG, SystemMemory, (Local0 &amp; <span class="number">0xFFFFFFFFFFFFFFF0</span>), <span class="number">0x8000</span>)</span><br><span class="line">                    Field (GREG, AnyAcc, NoLock, Preserve)</span><br><span class="line">                    &#123;</span><br><span class="line">                        Offset (<span class="number">0x6800</span>), </span><br><span class="line">                        GENA,   <span class="number">32</span>, </span><br><span class="line">                        GCTL,   <span class="number">32</span>, </span><br><span class="line">                        LTBC,   <span class="number">32</span>, </span><br><span class="line">                        Offset (<span class="number">0x6810</span>), </span><br><span class="line">                        PSBL,   <span class="number">32</span>, </span><br><span class="line">                        SSBL,   <span class="number">32</span>, </span><br><span class="line">                        PTCH,   <span class="number">32</span>, </span><br><span class="line">                        PSBH,   <span class="number">32</span>, </span><br><span class="line">                        SSBH,   <span class="number">32</span>, </span><br><span class="line">                        Offset (<span class="number">0x6848</span>), </span><br><span class="line">                        FCTL,   <span class="number">32</span>, </span><br><span class="line">                        Offset (<span class="number">0x6EF8</span>), </span><br><span class="line">                        MUMD,   <span class="number">32</span></span><br><span class="line">                    &#125;</span><br><span class="line"></span><br><span class="line">                    FCTL = Zero</span><br><span class="line">                    PSBH = Zero</span><br><span class="line">                    SSBH = Zero</span><br><span class="line">                    LTBC = Zero</span><br><span class="line">                    GENA = One</span><br><span class="line">                    MUMD = Zero</span><br><span class="line">                &#125;</span><br><span class="line"></span><br><span class="line">                Method (_DSM, <span class="number">4</span>, NotSerialized)  </span><br><span class="line">                &#123;</span><br><span class="line">                    If ((Arg2 == Zero))</span><br><span class="line">                    &#123;</span><br><span class="line">                        Return (Buffer (One)</span><br><span class="line">                        &#123;</span><br><span class="line">                             <span class="number">0x03</span> </span><br><span class="line">                        &#125;)</span><br><span class="line">                    &#125;</span><br><span class="line"></span><br><span class="line">                    Return (Package (<span class="number">0x02</span>)     </span><br><span class="line">                    &#123;                           <span class="comment">//设备属性注入位置</span></span><br><span class="line">                        <span class="string">"hda-gfx"</span>, </span><br><span class="line">                        Buffer (<span class="number">0x0A</span>)</span><br><span class="line">                        &#123;</span><br><span class="line">                            <span class="string">"onboard-1"</span></span><br><span class="line">                        &#125;</span><br><span class="line">                    &#125;)</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line"></span><br><span class="line">            Device (HDAU)                      <span class="comment">//音频传输驱动</span></span><br><span class="line">            &#123;</span><br><span class="line">                Name (_ADR, One) </span><br><span class="line">                OperationRegion (HDAH, PCI_Config, Zero, <span class="number">0x40</span>)</span><br><span class="line">                Field (HDAH, ByteAcc, NoLock, Preserve)</span><br><span class="line">                &#123;</span><br><span class="line">                    VID0,   <span class="number">16</span>, </span><br><span class="line">                    DID0,   <span class="number">16</span></span><br><span class="line">                &#125;</span><br><span class="line"></span><br><span class="line">                Method (_DSM, <span class="number">4</span>, NotSerialized) </span><br><span class="line">                &#123;</span><br><span class="line">                    If ((Arg2 == Zero))</span><br><span class="line">                    &#123;</span><br><span class="line">                        Return (Buffer (One)</span><br><span class="line">                        &#123;</span><br><span class="line">                             <span class="number">0x03</span> </span><br><span class="line">                        &#125;)</span><br><span class="line">                    &#125;</span><br><span class="line"></span><br><span class="line">                    Return (Package (<span class="number">0x02</span>)</span><br><span class="line">                    &#123;</span><br><span class="line">                        <span class="string">"hda-gfx"</span>, </span><br><span class="line">                        Buffer (<span class="number">0x0A</span>)</span><br><span class="line">                        &#123;</span><br><span class="line">                            <span class="string">"onboard-1"</span></span><br><span class="line">                        &#125;</span><br><span class="line">                    &#125;)</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li>
<li><h3 id="HDAS"><a href="#HDAS" class="headerlink" title="HDAS"></a>HDAS</h3><p>Z370主板的声卡设备ACPI名称为<font color="#FF8800">HDAS</font>，设备位置为<font color="#339922">“0x001f0003”</font>，新版AppleALC驱动会自动将HDAS重命名为HDEF。所以只要注入合适的id，就可以了。</p>
</li>
<li><h3 id="XHC"><a href="#XHC" class="headerlink" title="XHC"></a>XHC</h3><p>Z370主板USB设备地址为<font color="#FF8800">“0x00140000”</font>，包含14个USB2.0和10个USB3.0。ACPI默认驱动名称为XHC。关于USB端口定制下面会单独讲述。<br>主板ACPI部分到此结束。</p>
</li>
</ol>
<hr>
<h2 id="三、设备属性注入"><a href="#三、设备属性注入" class="headerlink" title="三、设备属性注入"></a>三、设备属性注入</h2><ol>
<li><h3 id="声卡"><a href="#声卡" class="headerlink" title="声卡"></a>声卡</h3><p>Asus z370-p主板声卡型号为ALC887，只需使用<font color="#339933">AppleALC.kext</font>驱动并为其注入<font color="#FF8800">layou-id</font>即可。<font color="#FF8800">layou-id</font>可选数值好像不止一个，台式机选5或7都可以。<br>以OpenCore为例：<br>在DeviceProperties的Add项目下添加<font color="#FF8800">PciRoot(0x0)/Pci(0x1f,0x03)</font>项，然后添加子项<font color="#FF8800">layout-id</font>为<font color="#FF8800">7</font>即可。</p>
<img src="laytou.png" width="80%">
</li>
<li><h3 id="核心显卡"><a href="#核心显卡" class="headerlink" title="核心显卡"></a>核心显卡</h3><p>Intel i7-8700k核显的id为<font color="#FF8800">0x3e92</font>。对于iMacPro机型来说，在Bios中关闭它是稳妥的做法。<br>一般来讲，使用iMac机型，需要设置核显为无显示连，作为辅助加速用。由于z370主板使用核显需要<font color="#339933">Whatevergreen.kext</font>驱动，所以不需要对其做额外设置。</p>
</li>
</ol>
<hr>
<h2 id="四、USB设备定制"><a href="#四、USB设备定制" class="headerlink" title="四、USB设备定制"></a>四、USB设备定制</h2><p>我们前面讨论了z370-p主板的<font color="#FF8800">XHC</font>情况，默认情况下苹果系统是不找<font color="#FF8800">XHC</font>的，因为苹果定义的是XHC1。如果我们把主板的<font color="#FF8800">XHC</font>重命名为<font color="#FF8800">XHC1</font>的话，系统会开启相应的某几个端口。但是我们不建议对ACPI做重命名，所以要想开启这些USB端口，就需要自己注入。以前流行的是SSDT方式，不过OpenCore上推荐使用UsbPorts做空壳驱动注入USB信息。<br>我们来看看这块主板的USB接口情况，USB定制是个细活，需要对所有位置的接口号了如指掌。</p>
<ul>
<li><p><strong>Asus Z370-p背板usb接口图：</strong></p>
<img src="z370usb1.jpg" width="80%" alt="Z370背板usb接口图">
我们看到最上段的HS09/HS10是USB2.0接口。下面的四个是2.0与30.复用的。通过排查，得到如上的对应关系。
</li>
<li><p><strong>Asus Z370-p主板扩展USB2.0插槽：</strong></p>
<img src="z370usb2.jpg" width="80%" alt="z370扩展主板USB2.0插槽">  
</li>
<li><p><strong>Asus Z370-p主板扩展USB3.0插槽：</strong></p>
<img src="z370usb3.jpg" width="80%" alt="z370扩展主板USB3.0插槽">
扩展插槽的使用端口定制，需要看你前面板是怎么连接主板扩展插槽的。
有了上面的数据，我们可以直接用Hcakintool工具生成一个USBPorts.kext文件，然后手动编辑里面的info.plist就可以了。注意：info.plist文件的配置是有机型设置的。Hcakintool会按照你当前机器的机型输出配置，如果我们想做一个几种机型都能用的，也很简单，加入其他机型的设置就可以。
手工编辑需要PlistEdit Pro这个软件，Xcode会不显示port的值。
<img src="usbinfo.png" width="80%" alt="UsbPort的info模版">
name不重要，重要的是port的值。形如 <font color="#FF8800">1x000000</font> 的，这种第一位为1的是USB3.0接口，第一位是0的为2.0接口。第二位为端口号，从1到F。因为苹果系统的限制，你所能使用的端口不超过15个，我不建议用 <font color="#FF8800">UsbinjetcALL</font>这个驱动把所有端口都开启。

</li>
</ul>
<hr>
<h2 id="五、内核扩展驱动"><a href="#五、内核扩展驱动" class="headerlink" title="五、内核扩展驱动"></a>五、内核扩展驱动</h2><p>常规动作就是需要在OpenCore的Kexts里放入：<font color="#339933">Lilu.kext  VirtualSMC.kext   AppkeALC.kext  RealtekRTL8111.kext  AppkeALC.kext   USBPorts.kext   USBPower.kext </font><br>如果需要使用核显还要加入<font color="#339933">WhateverGreen.kext</font>。<br>然后在OC的config.plist里写入相应配置。</p>
<hr>
<h2 id="六、显卡属性注入"><a href="#六、显卡属性注入" class="headerlink" title="六、显卡属性注入"></a>六、显卡属性注入</h2><ul>
<li>特别说明，显卡属性里使用<font color="#393">@</font>加数字，作为显示连接器接口的索引，第一个接口为<font color="#393">@0</font>，第二个为<font color="#393">@1</font>，以此类推。</li>
</ul>
<table>
<thead>
<tr>
<th>属性</th>
<th>样例</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>AAPL,slot-name</td>
<td>Slot-1</td>
<td>PCI 插槽名称，不建议使用</td>
</tr>
<tr>
<td>device-id</td>
<td>0x6768</td>
<td>仿冒显卡id，不仿冒不需要</td>
</tr>
<tr>
<td>model</td>
<td>Radeon Pro Vega56</td>
<td>与仿冒id联合使用，不仿冒不需要</td>
</tr>
<tr>
<td>hda-gfx</td>
<td>onboard-1</td>
<td>显卡音频传输设置，但要注意onboard后的索引不可冲突</td>
</tr>
<tr>
<td>CFG,CFG_FB_LIMIT</td>
<td></td>
<td>aty_config属性之一，AMD10000为0，AMD9500为6，一般不用设置</td>
</tr>
<tr>
<td>ATY,bin_image</td>
<td></td>
<td>显卡VBios数据，64k，为无法载入Vbios的笔记本使用</td>
</tr>
<tr>
<td>@0,display-dual-link</td>
<td></td>
<td>索引为0的显示连接器双链路带宽设置</td>
</tr>
<tr>
<td>@0,name</td>
<td>ATY,japura</td>
<td>注入帧缓存名称</td>
</tr>
<tr>
<td>connectors</td>
<td></td>
<td>连接器数据，制定FBName会失效</td>
</tr>
</tbody></table>
<p>另外，我们可以注入AMD显卡驱动配置项，如<font color="#393">aty_config</font>和<font color="#393">aty_properties</font>中的项目设置，具体可以查看相应驱动包中的info.plist配置</p>
<p>这些属性可以通过SSDT注入，也可以通过OpenCore或Clover中的<font color="#393">DeviceProperties</font>项目注入。<br>下图是仿照白苹果的参数注入的属性。<br><img src="DeviceProperties.png" width="80%" alt="显卡属性注入"><br>目前苹果系统的AMD显卡驱动不是很稳定，黑起来很玄学。</p>
<hr>
<h2 id="七、Vega56显卡输出接口修正"><a href="#七、Vega56显卡输出接口修正" class="headerlink" title="七、Vega56显卡输出接口修正"></a>七、Vega56显卡输出接口修正</h2><p>由于品牌与型号的差异，我们使用的显卡多不是苹果定制的类型，这就会出现与苹果显卡的显示接口不一致的问题。虽然WhateverGreen.kext能很好地适配显示接口，但它不负责指定FBName（FrameBufferName）。FBName的作用我理解是能更好地发挥显卡的效能，毕竟一个驱动要适配几种型号的显卡及不同机型，这区别就在FBName上，实际应用也验证了我的猜测。这不是WEG驱动的错，WEG不负责这个，一般情况下WEG还是不可替代的，它会省去我们很多麻烦。</p>
<p>FBName同时定义了显卡的显示接口及顺序，一旦在OC或Clover中指定了显卡的FBName，就有很大的概率出现某个或某几个显示接口不能使用或不正常的问题，不论你是否使用了WEG驱动。</p>
<p>（在翻阅10.13.6/10.14.5/10.15.2的AMD10000Controller时，发现里面的FBName在逐渐增多，由原来的Vega10/vega12增加到了Vega20/24等等，原来Vega56/64被定义为Radeon Pro，后来变成了Radeon RX，而Vega64FE/w9100才是Radeon Pro，这也就是为什么丢功能集问题的由来。）<br>猜测FBName是分显卡型号的，有某种对应关系，但是具体我们不是很清楚，只能一个一个地试。</p>
<p>修正显卡输出接口，确切地说是修正连接器数据，即<Font color="#393">connectors</font>。connectors具体数据被指定到相应的FBName中。如果我们在驱动是不指定FBName，我们可以直接注入connectors属性的方法来修正连机器端口。一旦在显卡设备属性中指定FBName，我们自己注入的Connectors数据就失去了作用。因为直接调用了FBName中定义的connectors数据。所以，可靠的办法是使用内核补丁的方式，直接操作FBName中的connectors</p>
<p>比如蓝宝石Vega56超白金OC板的显示接口为DP/DP/HDMI/HDMI，这个在AMD10000驱动的定义中是没有的。<br>通过筛选，AMD10000的驱动中只两个比较接近并可以使用的FBName。<br>Kamarang (4) DP, DP, DP, HDMI<br>Iriri (4)   DP, DP, DP, HDMI<br><img src="fbname1.png" width="80%" alt="显示接口">  </p>
<p>这是指定FBName后的结果，我们看到@2接口被Kamarang定义成了DP（就是右边显示的connector-type 0x400)，这与实际的接口HDMI是不一致的。@2这个端口就不能用了。</p>
<p>在强迫症的驱使下，我决定对@2接口进行修正。首先我们通过ATI_FrameBuffers_Edition.php这个php脚本得到接口的缓冲帧数据，我提取了两组FBName中的connectors，<br>Kamarang (4) DP, DP, DP, HDMI<br>000400000403000000010101000000002205020200000000<br>000400000403000000010201000000001204010100000000<br>000400000403000000010300000000001000050500000000<br>000800000402000000010400000000002001060600000000<br>还有Iriri (4) DP, DP, DP, HDMI 与Kamarang一模一样</p>
<p>据此我猜测，要让FrameBuffers数据变成DP,DP,HDMI,HDMI，大致是这个样。<br>Kamarang (4) DP, DP, HDMI, HDMI<br><font color="#c43">00040000</font><font color="#4c3">04030000</font><font color="#c4c">0001</font><font color="#4cc">0101</font>00000000<font color="#c43">22</font><font color="#4cc">05</font><font color="#c4c">02</font><font color="#4cc">02</font>00000000<br><font color="#c43">00040000</font><font color="#4c3">04030000</font><font color="#c4c">0001</font><font color="#4cc">0201</font>00000000<font color="#c43">12</font><font color="#4cc">04</font><font color="#c4c">01</font><font color="#4cc">01</font>00000000<br><font color="#c43">00080000</font><font color="#4c3">04020000</font><font color="#c4c">0001</font><font color="#4cc">0300</font>00000000<font color="#c43">10</font><font color="#4cc">00</font><font color="#c4c">05</font><font color="#4cc">05</font>00000000<br><font color="#c43">00080000</font><font color="#4c3">04020000</font><font color="#c4c">0001</font><font color="#4cc">0400</font>00000000<font color="#c43">20</font><font color="#4cc">01</font><font color="#c4c">06</font><font color="#4cc">06</font>00000000</p>
<p>按颜色分组说明以下各部分的意思。</p>
<table>
<thead>
<tr>
<th><font color="#c43">00080000</font></th>
<th><font color="#4c3">04020000</font></th>
<th><font color="#c4c">0001</font></th>
<th><font color="#4cc">0300</font></th>
<th>0000000</th>
<th><font color="#c43">20</font></th>
<th><font color="#4cc">01</font></th>
<th><font color="#c4c">06</font></th>
<th><font color="#4cc">06</font></th>
<th>00000000</th>
</tr>
</thead>
<tbody><tr>
<td>接口类型</td>
<td>控制标志</td>
<td>显示特征</td>
<td>占位符</td>
<td></td>
<td>发射器</td>
<td>解码器</td>
<td>热插拔ID</td>
<td>检测ID</td>
<td></td>
</tr>
</tbody></table>
<p>如果想深入了解FrameBuffer的数据结构，请拜读 @ljg-pcbeta 的教程 <a href="http://bbs.pcbeta.com/viewthread-1635607-1-1.html" target="_blank" rel="noopener">深入探索AMD显卡Framebuffer结构</a><br>热插拔ID和检测ID是显卡硬件物理属性，如果你修改了接口类型、控制标志、占位符等还没有让接口点亮，那就要调整热插拔ID和检测ID，这两个ID需要自行核实。对于比较早的AMD显卡可以用工具提取出这两个id，但是新的AMD显卡，还不能得到满意的结果。</p>
<p>整理一下，需要查找的数据是</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">000400000403000000010300000000001000050500000000000800000402000000010400000000002001060600000000</span></span><br></pre></td></tr></table></figure>
<p>替换成</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">000800000402000000010300000000001000050500000000000800000402000000010400000000002001060600000000</span></span><br></pre></td></tr></table></figure>
<p>现在把得到的数据做成补丁，写到kernel的patch里。<br><img src="fbnamepatch.png" width="80%" alt="显示接口修正补丁"><br>注意Xcode的书写格式。</p>
<p>特别强调，本节非必须。</p>
<p><font color="#f93">另外参见 <a href="http://zuoyoulz.top/2020/4-9/" target="_blank" rel="noopener">http://zuoyoulz.top/2020/4-9/</a> ，一种解决AMD显卡问题的全新思路。</font></p>
<hr>
<h2 id="八、独显黑屏"><a href="#八、独显黑屏" class="headerlink" title="八、独显黑屏"></a>八、独显黑屏</h2><p>对于Vega显卡黑屏问题，确切地说是DP显示接口黑屏，可用的HDMI接口是不黑屏的。<br>我们在升级系统的时候，有几种应对方式：</p>
<ul>
<li>使用WhateverGreen驱动；</li>
<li>使用HDMI显示器，不过HDMI显示器的刷新率是个问题；</li>
<li>如果使用DP显示器，不用WhateverGreen的情况下，需要打黑屏补丁。但是还是要先借助HDMI显示器或者WhateverGreen驱动，正常进入系统后重建系统缓存，然后就可以去掉WhateverGreen驱动了。<img src="blackscreen.png" width="80%" alt="DP显示器黑屏补丁"> 
这个补丁的原理就是把AppleGraphicsDevicePolicy.kext驱动中的字符串"board-id"强行替换为"board-ix"，以使AppleGraphicsDevicePolicy.kext驱动对机型设置检测失效。

</li>
</ul>
<hr>
<p><strong>参考</strong><br><a href="https://blog.xjn819.com/?p=543" target="_blank" rel="noopener">blog.xjn819.com</a><br><a href="https://github.com/daliansky/OC-little" target="_blank" rel="noopener">宪武 OC-little</a><br><a href="https://github.com/acidanthera/WhateverGreen/blob/master/Manual/Sample.dsl" target="_blank" rel="noopener">WhateverGreen_Sample.dsl</a></p>

    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/%E9%BB%91%E8%8B%B9%E6%9E%9C/" rel="tag"># 黑苹果</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/%E7%94%A8FreeBSD%E6%9E%B6%E8%AE%BEMacOS%E4%B8%93%E7%94%A8%E7%9A%84AFP%E6%96%87%E4%BB%B6%E6%9C%8D%E5%8A%A1%E5%99%A8/" rel="prev" title="用FreeBSD架设MacOS专用的AFP文件服务器">
      <i class="fa fa-chevron-left"></i> 用FreeBSD架设MacOS专用的AFP文件服务器
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/4-9/" rel="next" title="显示器接口修正及自定义FrameBuffer参数驱动黑苹果AMD显卡的新方式">
      显示器接口修正及自定义FrameBuffer参数驱动黑苹果AMD显卡的新方式 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#一、基本功课"><span class="nav-number">1.</span> <span class="nav-text">一、基本功课</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#主板Bios重点项目设置"><span class="nav-number">1.1.</span> <span class="nav-text">主板Bios重点项目设置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#核显与机型"><span class="nav-number">1.2.</span> <span class="nav-text">核显与机型</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#补充"><span class="nav-number">1.3.</span> <span class="nav-text">补充</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#二、调教ACPI"><span class="nav-number">2.</span> <span class="nav-text">二、调教ACPI</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#XCPM"><span class="nav-number">2.1.</span> <span class="nav-text">XCPM</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#EC控制器"><span class="nav-number">2.2.</span> <span class="nav-text">EC控制器</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#PMCR"><span class="nav-number">2.3.</span> <span class="nav-text">PMCR</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#RTC"><span class="nav-number">2.4.</span> <span class="nav-text">RTC</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#GRPW"><span class="nav-number">2.5.</span> <span class="nav-text">GRPW</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#BUS0"><span class="nav-number">2.6.</span> <span class="nav-text">BUS0</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#PEG0"><span class="nav-number">2.7.</span> <span class="nav-text">PEG0</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HDAS"><span class="nav-number">2.8.</span> <span class="nav-text">HDAS</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#XHC"><span class="nav-number">2.9.</span> <span class="nav-text">XHC</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#三、设备属性注入"><span class="nav-number">3.</span> <span class="nav-text">三、设备属性注入</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#声卡"><span class="nav-number">3.1.</span> <span class="nav-text">声卡</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#核心显卡"><span class="nav-number">3.2.</span> <span class="nav-text">核心显卡</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#四、USB设备定制"><span class="nav-number">4.</span> <span class="nav-text">四、USB设备定制</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#五、内核扩展驱动"><span class="nav-number">5.</span> <span class="nav-text">五、内核扩展驱动</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#六、显卡属性注入"><span class="nav-number">6.</span> <span class="nav-text">六、显卡属性注入</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#七、Vega56显卡输出接口修正"><span class="nav-number">7.</span> <span class="nav-text">七、Vega56显卡输出接口修正</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#八、独显黑屏"><span class="nav-number">8.</span> <span class="nav-text">八、独显黑屏</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="左右流之"
      src="/images/avatar.gif">
  <p class="site-author-name" itemprop="name">左右流之</p>
  <div class="site-description" itemprop="description">折腾不需要理由</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">9</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">3</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">11</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://gitee.com/halma/" title="Gitee → https:&#x2F;&#x2F;gitee.com&#x2F;halma&#x2F;" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>Gitee</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:459197097@qq.com" title="E-Mail → mailto:459197097@qq.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2025</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">左右流之</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://pisces.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/fancyapps/fancybox@3/dist/jquery.fancybox.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  













<script>
if (document.querySelectorAll('pre.mermaid').length) {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js', () => {
    mermaid.initialize({
      theme    : 'forest',
      logLevel : 3,
      flowchart: { curve     : 'linear' },
      gantt    : { axisFormat: '%m/%d/%Y' },
      sequence : { actorMargin: 50 }
    });
  }, window.mermaid);
}
</script>


  

  

  


<script>
NexT.utils.loadComments(document.querySelector('#valine-comments'), () => {
  NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
    var GUEST = ['nick', 'mail', 'link'];
    var guest = 'nick,mail,link';
    guest = guest.split(',').filter(item => {
      return GUEST.includes(item);
    });
    new Valine({
      el         : '#valine-comments',
      verify     : false,
      notify     : false,
      appId      : 'pj8AT7zpJyISRPiNehTuH3SM-gzGzoHsz',
      appKey     : 'A1fvdQLU97x0GozkPIR0KHDW',
      placeholder: "说点什么？",
      avatar     : 'mm',
      meta       : guest,
      pageSize   : '10' || 10,
      visitor    : false,
      lang       : '' || 'zh-cn',
      path       : location.pathname,
      recordIP   : false,
      serverURLs : ''
    });
  }, window.Valine);
});
</script>

</body>
</html>
